﻿using Microsoft.AspNetCore.Mvc;
using WMSUIMVC.DTO.Warehouseledger;
using XuanKeZz.Application.HTTP;

namespace WMSUIMVC.Controllers
{
    public class InventoryledgerController : Controller
    {
        protected readonly IConfiguration _configuration;

        public InventoryledgerController(IConfiguration configuration)
        {
            _configuration = configuration;
        }
        public IActionResult InventoryledgerIndex()
        {
            return View();
        }
        /// <summary>
        /// 仓库台账显示
        /// </summary>
        /// <param name="showclient"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ActionResult> GetWarehouseledgerShow(SelWarehouseledgerDTO showWarehouseledger)
        {
            HttpClientWrapper client = new HttpClientWrapper(showWarehouseledger.Token);
            string url = _configuration["Url"] + "ckd/api/Warehouseledger/GetStoreList?ProductsCode=" + showWarehouseledger.ProductsCode + "&ProductsName=" + showWarehouseledger.ProductsName + "&WarehouseId=" + showWarehouseledger.WarehouseId + "&PageIndex=" + showWarehouseledger.PageIndex + "&PageSize=" + showWarehouseledger.PageSize;
            string GetClient = await client.GetAsync(url);
            return Json(GetClient);
        }
    }
}
